#include <algorithm>
#include <cstdio>

typedef unsigned long long ull;

const int N = 2e5 + 5, base = 7, step = 3;
const ull mod = 50331653;
int n, m;
char str[N];
ull hash[26][N], qpow[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("equal.in", "r", stdin);
  freopen("equal.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &m);
  scanf("%s", str + 1);
  qpow[0] = 1;
  for (int i = 1; i <= n; ++i) {
    qpow[i] = qpow[i - 1] * base % mod;
    for (int j = 0; j < 26; ++j) { hash[j][i] = hash[j][i - 1] * base % mod; }
    hash[str[i] - 'a'][i] += step;
  }
  ull a[26], b[26];
  for (int i = 1, x, y, z; i <= m; ++i) {
    scanf("%d%d%d", &x, &y, &z);
    for (int j = 0; j < 26; ++j) {
      a[j] = (hash[j][x + z - 1] - hash[j][x - 1] * qpow[z] % mod + mod) % mod;
      b[j] = (hash[j][y + z - 1] - hash[j][y - 1] * qpow[z] % mod + mod) % mod;
    }
    bool flag = true;
    std::sort(a, a + 26), std::sort(b, b + 26);
    for (int j = 0; j < 26; ++j) flag = flag && a[j] == b[j];
    puts(flag ? "YES" : "NO");
  }
  return 0;
}